//
//  UpDateCollectionViewCell.m
//  A_Comic
//
//  Created by sos on 16/1/17.
//  Copyright © 2016年 sos. All rights reserved.
//

#import "UpDateCollectionViewCell.h"

@implementation UpDateCollectionViewCell
- (void)dealloc
{
    [_labelOne release];
    [_labelTwo release];
    [_labelThree release];
    [_img release];
    [super dealloc];
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        self.img = [[UIImageView alloc]init];
//        self.img.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:self.img];
        [self.img release];
        
        self.labelOne = [[UILabel alloc]init];
//        self.labelOne.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:self.labelOne];
        [self.labelOne release];
        
        self.labelTwo = [[UILabel alloc]init];
//        self.labelTwo.backgroundColor = [UIColor brownColor];
        [self.contentView addSubview:self.labelTwo];
        [self.labelTwo release];
        
        self.labelThree = [[UILabel alloc]init];
//        self.labelThree.backgroundColor = [UIColor orangeColor];
        [self.contentView addSubview:self.labelThree];
        [self.labelThree release];
        
        
        
        
        
    }
    return self;
}


-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    
    self.img.frame = CGRectMake(0, 0, layoutAttributes.frame.size.width/4, layoutAttributes.frame.size.height);
    
    self.labelOne.frame = CGRectMake(self.img.frame.size.width, 0, layoutAttributes.frame.size.width/2, layoutAttributes.frame.size.height/4);
     self.labelTwo.frame = CGRectMake(self.img.frame.size.width, self.labelOne.frame.size.height, layoutAttributes.frame.size.width/2, layoutAttributes.frame.size.height/4);
     self.labelThree.frame = CGRectMake(self.img.frame.size.width, self.labelTwo.frame.origin.y+self.labelTwo.frame.size.height, layoutAttributes.frame.size.width/2, layoutAttributes.frame.size.height/4);
    
    
   
    
    
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
